package day08_stream_file_charset.com.itheima.d3_recursion;

public class Test5_Recursion {
    public static void main(String[] args) {
        //猴子吃桃问题，10天
        System.out.println("f(1) = " + f(1));
        System.out.println("f(10) = " + f(10));
    }
    public static int f(int n) {
        if (n == 10) {
            return 1;
        }
        return 2 * f(n + 1) + 2;
    }

}
